<?php
session_start();
include_once '../c/config.php';
include_once 'c/Base.php';
if (isset($newCall) && !empty($newCall)){
	foreach ($newCall as $k=>$v){
		include_once 'c/'.$v.'.php';
	}
}
$action= 'index';
if (isset($_GET['c'])) {
	$controller = $_GET['c'];
}
if (isset($_GET['a'])){
	$action= $_GET['a'];
}
function call($controller, $action) {
	include_once('./controller/' . ucfirst($controller) . '.php');
	$instance = new $controller();
	$instance->{ $action }();
}
function _template(){
    global $controller, $action;
	$file='./view/'.strtolower($controller).'/'.$action.'.php';
	return $file;
}
function _temp($template){
	global $controller;
	$file='./view/'.strtolower($controller).'/'.$template.'.php';
	return $file;
}
call($controller, $action);


